package com.cloud.two.ribbon;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author henryGui
 * @version V1.0
 * @Title: ServiceRibbonApplication
 * @Package com.cloud.two.ribbon
 * @Description: TODO
 * @date 2018-06-18 下午1:59
 */
@SpringBootApplication
@EnableDiscoveryClient
//注解开启Hystrix
@EnableHystrix
//开启 Hystrix Dashboard (断路器：Hystrix 仪表盘)
//http://localhost:8764/hystrix
@EnableHystrixDashboard
public class ServiceRibbonApplication {

    public static void main(String[] args) {
        SpringApplication.run(ServiceRibbonApplication.class, args);
    }

    @Bean
    @LoadBalanced
    RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
